<?php

namespace App\Models\Guanyuan;

use App\Models\BaseModel;
use App\Models\Shop\ShopModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;

class GuanyuanSyncShopListModel extends BaseModel
{
    use HasFactory;

    protected $table = 'guanyuan_sync_shop_list';

    protected $fillable = [
        'region',
        'operationManager',
        'privateDomain',
        'takeawayStartTime',
        'code',
        'shopId',
        'name',
        'status',
        'businessType',
        'storeType',
        'cashierSystem',
        'province',
        'city',
        'district',
        'belongBranch',
        'address',
        'contractStartDate',
        'contractEndDate',
        'openBusinessDate',
        'closeDate',
        'franchiseFee',
        'managementFee',
        'transferFee',
        'area',
        'rent',
        'artificial',
        'energy',
        'employeesNum',
        'operationSupervision',
        'developmentManager',
        'siteLocationType',
        'inputPrice',
        'phone',
        'degreeOfCooperation',
        'franchiseeRealName',
        'franchiseeName',
        'franchiseConsultant',
        'preparatoryConsultant',
        'preparatoryFinishDate',
        'preparatoryStartDate',
        'preparatoryTimeConsumed',
        'openShopTimeConsumed',
        'lng',
        'lat',
        'designConsultant',
        'designStartDate',
        'designEndDate',
        'currentStatus',
        'currentNodeName',
        'estimatedOpeningTime',
        'relocationMark',
        'keyCity',
        'subStatus',
        'earliestRevenueDate',
        'orderNo',
        'confirmSiteDate',
        'actualIncome',
        'shopGrade',
        'createdAt',
        'updatedAt',
    ];

    public function guanyuanSyncShopBusinessRel()
    {
        return $this->hasMany(GuanyuanSyncShopBusinessModel::class, 'code', 'code');
    }

    public function shopRel()
    {
        return $this->hasOne(ShopModel::class, 'shopCode', 'code');
    }

}
